import request from '@/utils/request'

export default {

  /**
   * 讲师分页列表
   * @param {int} current 当前页
   * @param {int} size 
   * @param {object} teacherQuery 
   * @returns 
   */
  getListPage(current, size, teacherQuery) {
    return request({
      url:    `/edu/teacher/page/${current}/${size}`,
      method: 'post',
      data:   teacherQuery
    })
  },

  /**
   * 添加讲师
   * @param {object} teacherObj 讲师对象
   * @returns 
   */
  add(teacherObj) {
    return request({
      url:    `/edu/teacher/save`,
      method: 'post',
      data:   teacherObj
    })
  },

  /**
   * 根据ID查询讲师
   * @param {number} id 讲师ID
   * @returns 
   */
  getById(id) {
    return request({
      url:    `/edu/teacher/${id}`,
      method: 'get'
    })
  },

  /**
   * 修改讲师
   * @param {object} teacherObj 讲师对象
   * @returns 
   */
  update(teacherObj) {
    return request({
      url:    `/edu/teacher/${teacherObj.id}`,
      method: 'put',
      data:   teacherObj
    })
  },

  /**
   * 删除讲师
   * @param {string} id 讲师ID
   * @returns 
   */
  remove(id) {
    return request({
      url:    `/edu/teacher/${id}`,
      method: 'delete'
    })
  },

  
  

}

/**
 * 所有讲师列表
 */
export function getAllTeacher() {
  return request({
    url:    `/edu/teacher/all`,
    method: 'get'
  })
}

